/*
 * www.qwfys.com Inc.
 * Copyright (c) 2004- 2020 All Rights Reserved.
 */

package com.example.demo.config;


import org.springframework.context.annotation.Configuration;

import java.io.Serializable;
import java.time.format.DateTimeFormatter;
import java.util.Locale;

/**
 * @author lwk
 * @version MessageAo, v 0.1 6/4/20 4:03 PM lwk
 */
@Configuration
public class MvcConfig implements Serializable {

    // 时间格式化
    private static final DateTimeFormatter LOCAL_DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd", Locale.CHINA);
    private static final DateTimeFormatter LOCAL_DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss", Locale.CHINA);

    //@Bean
    //public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
    //
    //    return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder
    //            // 反序列化
    //            .deserializerByType(LocalDateTime.class, new LocalDateTimeDeserializer(LOCAL_DATE_TIME_FORMATTER))
    //            // 序列化
    //            .serializerByType(LocalDateTime.class, new LocalDateTimeSerializer(LOCAL_DATE_TIME_FORMATTER));
    //}
}
